package com.owen.rabbitmq;

import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Log4j2
@Component
@RabbitListener(queues = "sms")
public class SmsReceiver {

    @RabbitHandler
    public void receive(String in) throws InterruptedException {
//        StopWatch watch = new StopWatch();
//        watch.start();
        log.info("client2 Received "+ in);
//        watch.stop();
//        System.out.println("instance  [x] Done in " + watch.getTotalTimeSeconds() + "s");
    }

}
